package com.dragon.modules.yuegou.query.coupon;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.coupon.CouponTemplateStockEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 优惠券模板库存 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-06-30 17:39:39
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class CouponTemplateStockQuery extends CouponTemplateStockEntity implements Query<CouponTemplateStockEntity> {

    /** 优惠券模板ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 总库存查询条件 */
	@JsonUnwrapped(prefix = "stockTotal")
	private Condition<Integer> stockTotalCondition;

    /** 库存剩余查询条件 */
	@JsonUnwrapped(prefix = "stockSurplus")
	private Condition<Integer> stockSurplusCondition;

    /** 已用库存查询条件 */
	@JsonUnwrapped(prefix = "stockUse")
	private Condition<Integer> stockUseCondition;

    /** 出售库存总量查询条件 */
	@JsonUnwrapped(prefix = "saleTotal")
	private Condition<Integer> saleTotalCondition;

    /** 出售库存查询条件 */
	@JsonUnwrapped(prefix = "saleStock")
	private Condition<Integer> saleStockCondition;

    /** 发放量查询条件 */
	@JsonUnwrapped(prefix = "granted")
	private Condition<Integer> grantedCondition;

    /** 发放总库存查询条件 */
	@JsonUnwrapped(prefix = "grantTotal")
	private Condition<Integer> grantTotalCondition;

    /** 发放库存查询条件 */
	@JsonUnwrapped(prefix = "grantStock")
	private Condition<Integer> grantStockCondition;

    /** 版本查询条件 */
	@JsonUnwrapped(prefix = "version")
	private Condition<Integer> versionCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 最后更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public CouponTemplateStockQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public CouponTemplateStockQuery(CouponTemplateStockEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public CouponTemplateStockQuery(CouponTemplateStockQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.stockTotalCondition != null) {
			this.stockTotalCondition = other.stockTotalCondition.copy();
		}
		if(other.stockSurplusCondition != null) {
			this.stockSurplusCondition = other.stockSurplusCondition.copy();
		}
		if(other.stockUseCondition != null) {
			this.stockUseCondition = other.stockUseCondition.copy();
		}
		if(other.saleTotalCondition != null) {
			this.saleTotalCondition = other.saleTotalCondition.copy();
		}
		if(other.saleStockCondition != null) {
			this.saleStockCondition = other.saleStockCondition.copy();
		}
		if(other.grantedCondition != null) {
			this.grantedCondition = other.grantedCondition.copy();
		}
		if(other.grantTotalCondition != null) {
			this.grantTotalCondition = other.grantTotalCondition.copy();
		}
		if(other.grantStockCondition != null) {
			this.grantStockCondition = other.grantStockCondition.copy();
		}
		if(other.versionCondition != null) {
			this.versionCondition = other.versionCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<CouponTemplateStockEntity> toQueryWrapper() {
		QueryWrapper<CouponTemplateStockEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (stockTotalCondition != null) {
			stockTotalCondition.toWrapper(wrapper, COL_STOCK_TOTAL);
		}
		if (stockSurplusCondition != null) {
			stockSurplusCondition.toWrapper(wrapper, COL_STOCK_SURPLUS);
		}
		if (stockUseCondition != null) {
			stockUseCondition.toWrapper(wrapper, COL_STOCK_USE);
		}
		if (saleTotalCondition != null) {
			saleTotalCondition.toWrapper(wrapper, COL_SALE_TOTAL);
		}
		if (saleStockCondition != null) {
			saleStockCondition.toWrapper(wrapper, COL_SALE_STOCK);
		}
		if (grantedCondition != null) {
			grantedCondition.toWrapper(wrapper, COL_GRANTED);
		}
		if (grantTotalCondition != null) {
			grantTotalCondition.toWrapper(wrapper, COL_GRANT_TOTAL);
		}
		if (grantStockCondition != null) {
			grantStockCondition.toWrapper(wrapper, COL_GRANT_STOCK);
		}
		if (versionCondition != null) {
			versionCondition.toWrapper(wrapper, COL_VERSION);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回优惠券模板ID查询条件
	 * 
	 * @return idCondition 优惠券模板ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取优惠券模板ID查询条件
	 * 
	 * @return idCondition 优惠券模板ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置优惠券模板ID查询条件
	 * 
	 * @param idCondition 优惠券模板ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回总库存查询条件
	 * 
	 * @return stockTotalCondition 总库存查询条件
	 */
	public Condition<Integer> stockTotal() {
		this.stockTotalCondition = new Condition<>();
		return this.stockTotalCondition;
	}
	
	/**
	 * 获取总库存查询条件
	 * 
	 * @return stockTotalCondition 总库存查询条件
	 */
	public Condition<Integer> getStockTotalCondition() {
		return stockTotalCondition;
	}

	/**
	 * 设置总库存查询条件
	 * 
	 * @param stockTotalCondition 总库存查询条件
	 */
	public void setStockTotalCondition(Condition<Integer> stockTotalCondition) {
		this.stockTotalCondition = stockTotalCondition;
	}

	/**
	 * 构造并返回库存剩余查询条件
	 * 
	 * @return stockSurplusCondition 库存剩余查询条件
	 */
	public Condition<Integer> stockSurplus() {
		this.stockSurplusCondition = new Condition<>();
		return this.stockSurplusCondition;
	}
	
	/**
	 * 获取库存剩余查询条件
	 * 
	 * @return stockSurplusCondition 库存剩余查询条件
	 */
	public Condition<Integer> getStockSurplusCondition() {
		return stockSurplusCondition;
	}

	/**
	 * 设置库存剩余查询条件
	 * 
	 * @param stockSurplusCondition 库存剩余查询条件
	 */
	public void setStockSurplusCondition(Condition<Integer> stockSurplusCondition) {
		this.stockSurplusCondition = stockSurplusCondition;
	}

	/**
	 * 构造并返回已用库存查询条件
	 * 
	 * @return stockUseCondition 已用库存查询条件
	 */
	public Condition<Integer> stockUse() {
		this.stockUseCondition = new Condition<>();
		return this.stockUseCondition;
	}
	
	/**
	 * 获取已用库存查询条件
	 * 
	 * @return stockUseCondition 已用库存查询条件
	 */
	public Condition<Integer> getStockUseCondition() {
		return stockUseCondition;
	}

	/**
	 * 设置已用库存查询条件
	 * 
	 * @param stockUseCondition 已用库存查询条件
	 */
	public void setStockUseCondition(Condition<Integer> stockUseCondition) {
		this.stockUseCondition = stockUseCondition;
	}

	/**
	 * 构造并返回出售库存总量查询条件
	 * 
	 * @return saleTotalCondition 出售库存总量查询条件
	 */
	public Condition<Integer> saleTotal() {
		this.saleTotalCondition = new Condition<>();
		return this.saleTotalCondition;
	}
	
	/**
	 * 获取出售库存总量查询条件
	 * 
	 * @return saleTotalCondition 出售库存总量查询条件
	 */
	public Condition<Integer> getSaleTotalCondition() {
		return saleTotalCondition;
	}

	/**
	 * 设置出售库存总量查询条件
	 * 
	 * @param saleTotalCondition 出售库存总量查询条件
	 */
	public void setSaleTotalCondition(Condition<Integer> saleTotalCondition) {
		this.saleTotalCondition = saleTotalCondition;
	}

	/**
	 * 构造并返回出售库存查询条件
	 * 
	 * @return saleStockCondition 出售库存查询条件
	 */
	public Condition<Integer> saleStock() {
		this.saleStockCondition = new Condition<>();
		return this.saleStockCondition;
	}
	
	/**
	 * 获取出售库存查询条件
	 * 
	 * @return saleStockCondition 出售库存查询条件
	 */
	public Condition<Integer> getSaleStockCondition() {
		return saleStockCondition;
	}

	/**
	 * 设置出售库存查询条件
	 * 
	 * @param saleStockCondition 出售库存查询条件
	 */
	public void setSaleStockCondition(Condition<Integer> saleStockCondition) {
		this.saleStockCondition = saleStockCondition;
	}

	/**
	 * 构造并返回发放量查询条件
	 * 
	 * @return grantedCondition 发放量查询条件
	 */
	public Condition<Integer> granted() {
		this.grantedCondition = new Condition<>();
		return this.grantedCondition;
	}
	
	/**
	 * 获取发放量查询条件
	 * 
	 * @return grantedCondition 发放量查询条件
	 */
	public Condition<Integer> getGrantedCondition() {
		return grantedCondition;
	}

	/**
	 * 设置发放量查询条件
	 * 
	 * @param grantedCondition 发放量查询条件
	 */
	public void setGrantedCondition(Condition<Integer> grantedCondition) {
		this.grantedCondition = grantedCondition;
	}

	/**
	 * 构造并返回发放总库存查询条件
	 * 
	 * @return grantTotalCondition 发放总库存查询条件
	 */
	public Condition<Integer> grantTotal() {
		this.grantTotalCondition = new Condition<>();
		return this.grantTotalCondition;
	}
	
	/**
	 * 获取发放总库存查询条件
	 * 
	 * @return grantTotalCondition 发放总库存查询条件
	 */
	public Condition<Integer> getGrantTotalCondition() {
		return grantTotalCondition;
	}

	/**
	 * 设置发放总库存查询条件
	 * 
	 * @param grantTotalCondition 发放总库存查询条件
	 */
	public void setGrantTotalCondition(Condition<Integer> grantTotalCondition) {
		this.grantTotalCondition = grantTotalCondition;
	}

	/**
	 * 构造并返回发放库存查询条件
	 * 
	 * @return grantStockCondition 发放库存查询条件
	 */
	public Condition<Integer> grantStock() {
		this.grantStockCondition = new Condition<>();
		return this.grantStockCondition;
	}
	
	/**
	 * 获取发放库存查询条件
	 * 
	 * @return grantStockCondition 发放库存查询条件
	 */
	public Condition<Integer> getGrantStockCondition() {
		return grantStockCondition;
	}

	/**
	 * 设置发放库存查询条件
	 * 
	 * @param grantStockCondition 发放库存查询条件
	 */
	public void setGrantStockCondition(Condition<Integer> grantStockCondition) {
		this.grantStockCondition = grantStockCondition;
	}

	/**
	 * 构造并返回版本查询条件
	 * 
	 * @return versionCondition 版本查询条件
	 */
	public Condition<Integer> version() {
		this.versionCondition = new Condition<>();
		return this.versionCondition;
	}
	
	/**
	 * 获取版本查询条件
	 * 
	 * @return versionCondition 版本查询条件
	 */
	public Condition<Integer> getVersionCondition() {
		return versionCondition;
	}

	/**
	 * 设置版本查询条件
	 * 
	 * @param versionCondition 版本查询条件
	 */
	public void setVersionCondition(Condition<Integer> versionCondition) {
		this.versionCondition = versionCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回最后更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 最后更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取最后更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 最后更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置最后更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 最后更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

}
